<?php
    if(!isset($_COOKIE['username'])){
        echo "<script>alert('您尚未登录，请先登录！');window.location.href='./login.php'</script>";
        die;
    }
?>